<include file="Public:header" />

<div id="home">

    <div id="header">

        <div style="height:28px; padding-top:10px; background:url(__PUBLIC__/Front/images/xy.png) 10px 8px no-repeat" class="logo"><span onclick=" history.go(-1);">&nbsp;</span></div>

        <div class="shoptitle"><span>会员提现</span></div>

        <include file="Public:righttop" />

    </div>

</div>

<include file="Public:procat" />

<style type="text/css">

    .tx-top{
        margin: 0 10px;
    }
    .tx-top p{
        padding: 15px 0;
    }
    .tx-top span{
        color: #FF0000;
    }

    .tx-content{
        padding: 0 10px;
        margin-bottom: 100px;
    }
    .tx-content li{
        border: 1px solid #eaeaea;
        border-radius: 5px;
        padding: 10px 0;
        position: relative;
        margin-bottom: 20px;
    }
    .tx-content input{
        color: #999999;
        padding-left: 10px;
        font-size: 16px;

        line-height: 40px;
    }

    .tips{
        line-height: 30px;
        color: #FF0000;
    }


    .tx-button{
        position: fixed;
        bottom:55px;
        width: 100%;
        max-width: 620px;
        min-width: 320px;
    }
    .tx-button ul{
        overflow: hidden;
        width: 100%;
    }
    .tx-button li{
        width: 46%;
    }
    .tx-button input{
        border-radius: 5px;
        padding: 10px 0;
        width: 100%;
        background: #328c09;
        color: #FFFFFF;
        font-size: 18px;
    }

</style>

<script type="text/javascript">

    var balance = "{$balance}";


//检测提现信息信息正确性
    function  check_score() {

        var t = /^\d+(\.\d+)?$/;

        var $score = $("input[name='total' ]").val().replace(/\s/g, "");

        var aa = t.test($score);

        if (!aa || ($score < 50)) {

            jAlert('提现金额不能低于50元', '警告');

            return false;
        }

        return $score;
    }

//   操作button
    function  form_submit($val) {

        //表单提交
        if ($val == '1') {

//            console.log($("form").serialize());return;

            var score = $('input[name="total"]').val();

            if (!check_score(score)) {

                jAlert('提现金额不能低于50元!', '警告');
                return;
            }

            if (parseInt(score) > parseInt(balance)) {

                jAlert('您的余额不足!', '警告');
                return;
            }

            $('form').submit();

        } else if ($val == '2') {

            window.location.href = "{:U('Member/cash_record')}";

        } else {
            return;
        }

    }

</script>

<div id="main" style="background:#fff;">

    <header class="tx-top">

        <p>当前账户余额&nbsp;:<span>{$balance}</span></p>

    </header>

    <form id="form_withdrawal"  action="{:U('Member/member_cash')}"  method="post">


        <input type="hidden" name="user_id" value="{$member_bank.user_id}" />

        <input type="hidden" name="member_balance" value="{$balance}" />

        <input type="hidden" name="fee_scale" value="{$withdrawal_scale}" />

        <input type="hidden" name="phone" value="{$member_bank.phone}" />


        <nav class="tx-content">
            <ul>

                <li>

                    <span style="padding: 0 10px;border-right: 1px solid #eaeaea;">持&ensp;卡&ensp;人</span>

                    <input type="text" name="account_name" value="{$member_bank.account_name}" readonly="readonly"  placeholder='姓名' />

                </li>

                <li>

                    <span style="padding: 0 10px;border-right: 1px solid #eaeaea;">提现银行</span>

                    <input type="text" name="bank_name" value="{$member_bank.bank_name}" readonly="readonly"  placeholder='例：中国银行' />

                </li>

                <li>

                    <span style="padding: 0 10px;border-right: 1px solid #eaeaea;">提现卡号</span>

                    <input type="text" name="account_bank" value="{$member_bank.account_bank}" readonly="readonly"  placeholder='例：6228 **** 0256 **** 018' />

                </li>

                <li>

                    <span style="padding: 0 10px;border-right: 1px solid #eaeaea;">提现金额</span>

                    <input type="text" name="total" value="提现金额:50"  onblur="if (value == '') {
                                value = '提现金额:50';
                            } else {

                                return check_score();
                            }" onfocus="if (value == '提现金额:50') {
                                        value = '';
                                    }" />

                    <span style="position: absolute;right: 10px; line-height: 40px">元</span>

                </li>

                <li>

                    <span style="padding: 0 10px;border-right: 1px solid #eaeaea;">提现备注</span>

                    <input type="text" name="remark" value=""  placeholder='留下备注'  />
                </li>

                <a href="{:U('Member/bankcard_list')}" style="text-align: center; padding-bottom: 20px;width: 100%; display: block;text-decoration: underline;">管理银行卡</a>

            </ul>

            <div class="tips">

                <p>提示：</p>
                <p>银行卡提现最低提现额度为50元
                <p>银行卡提现收取手续费{$withdrawal_scale}%</p>
                <p>银行卡提现在后台确认后3-5个工作日到帐</p>

            </div>

        </nav>

        <div class="tx-button">

            <ul>
                <li style="float: left;"><input type="button" name="sendrecord" onclick ='form_submit("2")' value="提现记录" style='background:#aaa'/></li>

                <li style="float: right;"><input type="button" name="sendscore" onclick='form_submit("1")' value="立即提现"/></li>
            </ul>

        </div>

    </form>

</div>

<include file="Public:footer" />